package kr.hkit.androidcomplete02.ch17;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class Add extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch17_add);
		
		Intent intent = getIntent();
		int left = intent.getIntExtra("left", 0);
		int right = intent.getIntExtra("right", 0);
		
		TextView tv = (TextView) findViewById(R.id.result);
		tv.setText(String.format("%d + %d = %d", left, right, left+right));
	}
}
